<template>
  <el-dialog
    :title="`${
      type == 1 ? '课堂表现分' : type == 3 ? '纪律表现分' : '其他表现分'
    }`"
    :visible.sync="isshow"
    width="800px"
  >
    <div>
      <div class="topText">
        <span>课程：{{ data.courseName }}</span>
        <!-- <span
          >班级{{
            type == 1 ? "课堂表现分" : type == 3 ? "纪律表现分" : "其他表现分"
          }}：{{ data.dateavgScore }}</span
        >
        <span>
          个人{{
            type == 1 ? "课堂表现分" : type == 3 ? "纪律表现分" : "其他表现分"
          }}：{{ type == 2 ? homeworScroe : selfdScroe }}
        </span> -->
      </div>
      <!--      表格-->
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="score" label="打分" align="center">
        </el-table-column>
        <el-table-column prop="teacherName" label="打分教师" align="center">
        </el-table-column>
        <el-table-column
          sortable
          prop="operateTime"
          label="打分时间"
          align="center"
          width="180"
        >
          <template slot-scope="scope">
            {{ parseTime(scope.row.operateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          prop="remark"
          label="打分备注"
          align="center"
          width="300"
        >
          <template slot-scope="scope">
            {{ scope.row.remark ? scope.row.remark : '--' }}
          </template>
        </el-table-column>
      </el-table>
    </div>
  </el-dialog>
</template>
<script>
import { detailusuallyPoints } from '@/api/tea_studentGrade/usual'
import { parseTime } from '@/utils/cc'

export default {
  components: {},
  name: 'datescoredetail',
  data() {
    return {
      isshow: false,
      courseStuId: '',
      tableData: [],
      data: {},
      type: ''
    }
  },
  mounted() {
  },
  methods: {
    parseTime,
    show(obj) {
      this.type = obj.type
      this.courseStuId = obj.courseStuId
      this.isshow = true
      this.getList()
    },
    async getList() {
      this.loading = true
      try {
        let res = await detailusuallyPoints(this.courseStuId, {
          type: this.type
        })
        const { code, data } = res
        if (code == 200) {
          this.data = data
          this.tableData = data.list
        }
      } catch (error) {
        console.error(error)
      } finally {
        this.loading = false
      }
    }
  }
}
</script>
<style scoped lang="scss">
.topText {
  margin-bottom: 20px;
  font-family: PingFangSC, PingFang SC, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #333333;

  span {
    margin-right: 20px;
  }

  .itemLable {
    font-family: PingFangSC, PingFang SC, sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #333333;
  }
}
</style>
